/*
 * Copyright (c) 2008, Xiong Yingfei, the University of Tokyo
 * All rights reserved.
 */
package ac.jp.u_tokyo.SyncLib.tests;

import java.util.HashMap;
import java.util.Map;

import org.junit.Before;

import ac.jp.u_tokyo.SyncLib.Mod;
import ac.jp.u_tokyo.SyncLib.NullMod;
import ac.jp.u_tokyo.SyncLib.SynchronizationFailedException;
import ac.jp.u_tokyo.SyncLib.dictionaries.StaticGet;

public class StaticGetTest extends GetTestBase
{

	private StaticGet<String> _sync;

	@Before
	public void setUp() throws SynchronizationFailedException
	{
		StaticGet<String> staticGet = new StaticGet<String>(KEY, true);
		staticGet.resynchronize(new Object[] {new HashMap(), null}, new Mod[] {NullMod.INSTANCE, NullMod.INSTANCE});
		_sync = staticGet;
	}
	
	@Override
	protected Mod[] internalSynchronize(Mod dictMod1,
			Mod<Integer> mod1) throws SynchronizationFailedException
	{
		return _sync.synchronize(new Mod[] { dictMod1,
				mod1});
	}

	@Override
	protected Mod[] internalResynchronize(Map<String, Integer> map1,
			Integer v1, 
			Mod dictMod1, Mod<Integer> mod1)
			throws SynchronizationFailedException
	{
		return _sync.resynchronize(new Object[] {map1, v1}, new Mod[] {dictMod1, mod1});
	}

	@Override
	protected void setDictOverVal(boolean dictOverVal)
	{
		_sync.setDictOverVal(dictOverVal);
		
	}

}
